using System;
using System.Collections.Generic;
using System.Text;
using TextEditor.TextDocument.frmWindow;
using Bifrost;

namespace TextEditor.TextDocument
{
    public class A_InsertSurgery : A_Action
    {
        public override string ActionName()
        {
            return "insertsurgery";
        }

        public override bool Execute()
        {           
            return false;
        }

        void surgerylist_ChangleSelect(object sender, BackEvenHandle e)
        {
            if (e.Para != "")
            {
                base.OwnerDocument._InsertString(e.Para);
            }
        }

        public override bool UIExecute()
        {
            //using (frmSurgeryList surgerylist = new frmSurgeryList(base.OwnerDocument.Us.InpatientInfo.Id.ToString()))
            //{
            //    App.FormStytleSet(surgerylist, false);
            //    surgerylist.ChangleSelect += new EventHandler<BackEvenHandle>(surgerylist_ChangleSelect);
            //    surgerylist.ShowDialog();
            //}
            return false;
        }

        public override bool isEnable()
        {
            return base.myOwnerDocument.CanModify() && base.myOwnerDocument.Us.InpatientInfo != null;
        }
    }
}
